//
//  IssuedByTheDynamicViewController.m
//  DefendHealth
//
//  Created by 吾诺翰卓003 on 17/2/20.
//  Copyright © 2017年 iMacOne. All rights reserved.
//

#import "IssuedByTheDynamicViewController.h"

@interface IssuedByTheDynamicViewController ()

@end

@implementation IssuedByTheDynamicViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.TitleNav.text = @"发布图文动态";
    
    UIButton *releaseBtn = [[UIButton alloc] initWithFrame:CGRectMake(WindowWidth-10-[ToolUtil autoWidth:@"完成" width:500 height:13 num:13], 20, [ToolUtil autoWidth:@"完成" width:500 height:13 num:13], 44)];
    [releaseBtn setTitle:@"完成" forState:UIControlStateNormal];
    [releaseBtn addTarget:self action:@selector(finish) forControlEvents:UIControlEventTouchUpInside];
    releaseBtn.titleLabel.font = FONT(13);
    releaseBtn.titleLabel.textAlignment = 2;
    [releaseBtn setTitleColor:[ImageUtil colorWithRgb:0x333333] forState:0];
    [self.view addSubview:releaseBtn];
    [self addView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)addView{
    UIView *view1 = [UIView new];
        view1.backgroundColor = [UIColor whiteColor];
    
    
    UITextField * nameTf = [UITextField new];
    nameTf.frame = CGRectMake(10, 19, WindowWidth-20, 14);
    nameTf.delegate = self;
    [view1 addSubview:nameTf];
    nameTf.font = FONT(14);
    nameTf.placeholder = @"分享你的动态 记录你的喜悦和汗水";
    
    UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(10, kMaxY(nameTf.frame)+68, 56, 56)];
    [btn1 setTitle:@"+" forState:UIControlStateNormal];
    [btn1 addTarget:self action:@selector(jiazhaopian) forControlEvents:UIControlEventTouchUpInside];
    btn1.titleLabel.font = FONT(30);
    btn1.backgroundColor = [ImageUtil colorWithRgb:0xebebea];
    [btn1 setTitleColor:[UIColor blackColor] forState:0];
    [view1 addSubview:btn1];
    
    UIView *hui = [UIView new];
    hui.frame = CGRectMake(0, kMaxY(btn1.frame)+25,WindowWidth , 2.5);
    hui.backgroundColor = kLineColor;
    [view1 addSubview:hui];
    
    view1.frame = CGRectMake(0, 64,WindowWidth , kMaxY(hui.frame));
    [self.view addSubview:view1];
    
    NSArray *titleArr = @[@"地点",@"仅好友可以查看",@"同时分享至朋友圈"];
    for (int i = 0; i<titleArr.count; i++) {
        UIView *view2 = [UIView new];
        view2.frame = CGRectMake(0, kMaxY(view1.frame)+47*i,WindowWidth , 47);
        view2.backgroundColor = [UIColor whiteColor];
        [self.view addSubview:view2];
        
        UILabel *titlelab1 = [UILabel new];
        titlelab1.frame = CGRectMake(10, 0, 150, 47);
        titlelab1.text = titleArr[i];
        titlelab1.font = FONT(14);
        titlelab1.textColor = UIColorFromRGB(0x333333);
        titlelab1.textAlignment = 0;
        [view2 addSubview:titlelab1];
        
        if (i == 0) {
            UILabel *contentlab1 = [UILabel new];
            contentlab1.frame = CGRectMake(WindowWidth-10-150, 0, 150, 47);
            contentlab1.text = @"中赢国际(西门1)";
            contentlab1.font = FONT(14);
            contentlab1.textColor = UIColorFromRGB(0x333333);
            contentlab1.textAlignment = 2;
            [view2 addSubview:contentlab1];
        }
        if (i == 1) {
            UISwitch *sw = [UISwitch new];
            sw.frame = CGRectMake(WindowWidth-10-10-40, 10, 40, 47);
            [sw setTintColor:[UIColor blackColor]];
            [sw setThumbTintColor:[UIColor whiteColor]];
            [sw setOnTintColor:[UIColor blackColor]];
            [view2 addSubview:sw];
            sw.on = YES;
        }
        if (i == 2) {
            UISwitch *sw = [UISwitch new];
            sw.frame = CGRectMake(WindowWidth-10-10-40, 10, 40, 47);
            [sw setTintColor:[UIColor blackColor]];
            [sw setThumbTintColor:[UIColor whiteColor]];
            [sw setOnTintColor:[UIColor blackColor]];
            [view2 addSubview:sw];
            sw.on = YES;
        }
        UIView *hui = [UIView new];
        hui.frame = CGRectMake(12, 45.5,WindowWidth-24 , 1.5);
        hui.backgroundColor = kLineColor;
        [view2 addSubview:hui];
    }
}



-(void)finish{
    
}
-(void)jiazhaopian{
    
}
@end
